CXX=/usr/bin/g++
NVCC=/usr/local/cuda/bin/nvcc

tester: libdevice.dylib host.o
	$(CXX)  -arch i386 -O3  -o tester host.o libdevice.dylib -L. -L/usr/local/cuda/lib -lcudart

libdevice.dylib: device.cu
	$(NVCC) -Xcompiler -dynamiclib  -O3   -c -o libdevice.dylib device.cu  -I/usr/local/cuda/include --host-compilation C++

host.o: host.cpp
	$(CXX) -arch i386 -O3 -c  -o host.o host.cpp -I/usr/local/cuda/include 




clean:
	rm -f *.o *.dylib